package com.ocm.tourism.core.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.TableGenerator;
import javax.persistence.Version;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.beans.factory.annotation.Configurable;

@Configurable
@Entity
public class FileInfo {

   @NotNull
   @Size(max = 150)
   private String name;

   @NotNull
   @Size(max = 25)
   private String mimetypes;

   @NotNull
   @Size(max = 25)
   private String extension;

   @NotNull
   @Size(max = 250)
   private String originalfileName;

   @NotNull
   @Size(max = 250)
   private String absolutePath;

   @Enumerated
   private FileInfoType fileInfoType;

   @Size(max=250)
   private String fileDetail;

   public String toString() {
      return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
   }

   @Id
   @GeneratedValue(strategy=GenerationType.TABLE,generator="GEN_FILEINFO")
   @TableGenerator(name = "GEN_FILEINFO", table = "SEQUENCE_LIST", allocationSize = 1, initialValue = 1, pkColumnName = "NAME", valueColumnName = "NEXT_SEQUENCE", pkColumnValue = "FILEINFO")
   private Long id;

   @Version
   @Column(name = "version")
   private Integer version;

   public Long getId() {
      return this.id;
   }

   public void setId(Long id) {
      this.id = id;
   }

   public Integer getVersion() {
      return this.version;
   }

   public void setVersion(Integer version) {
      this.version = version;
   }

   public String getName() {
      return name;
   }

   public void setName(String name) {
      this.name = name;
   }

   public String getMimetypes() {
      return mimetypes;
   }

   public void setMimetypes(String mimetypes) {
      this.mimetypes = mimetypes;
   }

   public String getExtension() {
      return extension;
   }

   public void setExtension(String extension) {
      this.extension = extension;
   }

   public String getOriginalfileName() {
      return originalfileName;
   }

   public void setOriginalfileName(String originalfileName) {
      this.originalfileName = originalfileName;
   }

   public FileInfoType getFileInfoType() {
      return fileInfoType;
   }

   public void setFileInfoType(FileInfoType fileInfoType) {
      this.fileInfoType = fileInfoType;
   }

   public String getAbsolutePath() {
      return absolutePath;
   }

   public void setAbsolutePath(String absolutePath) {
      this.absolutePath = absolutePath;
   }

   public String getFileDetail() {
      return fileDetail;
   }

   public void setFileDetail(String fileDetail) {
      this.fileDetail = fileDetail;
   }
}
